package com.anrongtec.zcpt.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by huiliu on 2017/7/4.
 *
 * @email liu594545591@126.com
 */

public class MainTabAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private String[] titles = {"我的应用", "应用管理"};

    public MainTabAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int fragment) {
        return fragments.get(fragment);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}